const path = require("path");
const config = require('./config').test;
const webpack = require('webpack');
const HTMLWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin'); 

module.exports = {
    entry:{
      index: path.join(__dirname,config.input),
      vendor:['lodash']
    },
    plugins:[
        new HTMLWebpackPlugin({
            title:'Code Splitting'
        }),
        new webpack.HashedModuleIdsPlugin(),
        new webpack.optimize.CommonsChunkPlugin({
            names:'vendor'
        }),
        new webpack.optimize.CommonsChunkPlugin({
            name: 'runtime'
        })
    ],
    output:{
        path:path.join(__dirname,config.output),
        filename:'[name][chunkhash].bundle.js',
    }
}